package com.example.demo1.rabbitmq;

import com.example.demo1.wyy.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Lx on 2018/7/6.
 */
@RestController
public class RabbitMqSendController {
    @Autowired
    private StreamClient streamClient;

    @GetMapping("rabbit/test")
    public void send(){
        User user = new User();
        user.setCode("Test");
        user.setName("XIAOMING");
        user.setStatus(10);
        streamClient.output().send(org.springframework.integration.support.MessageBuilder.withPayload(user).build());
    }
}
